'''
__call_让一个类对象拥有了被调用的行为。
'''


class Test():
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def __call__(self):
        print('call me! {}'.format(self.name))


t = Test('name1', 'age1')
print(t.name)
t.name = 'tianchuan'
t()  # call me
